<template>
    <div>
        <header>
            
            <div class="search">
                <el-form :inline="true" :model="searchData" class="demo-form-inline">
                    <el-form-item label="分类名称：">
                        <el-input placeholder="分类名称" v-model="searchData.searchName"></el-input>
                    </el-form-item>
                    <el-form-item >
                        <el-button type="primary" icon="el-icon-search"  @click="search" size="medium">查询</el-button>
                    </el-form-item>
                    <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add" style="margin-bottom:20px;" size="medium">添加分类</el-button>
                </el-form>
            </div>
        </header>
        <div class="list">
            <div class="list-opate">
                <el-table :data="list.data" style="width: 100%" max-height="618">
                    <el-table-column prop="st_id" label="分类ID" align="center"></el-table-column>
                    <el-table-column prop="st_name" label="分类名称" align="center"></el-table-column>
                    <el-table-column prop="st_type_name" label="前台name名" align="center"></el-table-column>
                    <el-table-column prop="st_create_time" label="添加时间" align="center"></el-table-column>
                    <el-table-column prop="st_update_time" label="修改时间" align="center"></el-table-column>
                    <el-table-column label="操作" align="center">
                        <template slot-scope="scope">
                            <el-button @click="look(scope.row)" type="text" size="small">查看种类</el-button>
                            <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
                            <el-button @click="del(scope.row)" type="text" size="small">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <!-- 分类 分页 -->
                <el-pagination :current-page="current" @current-change="handleCurrentChange" :total="list.total" style="margin-top:30px;"></el-pagination>
            </div>

        </div>
        <!-- 添加分类 -->
        <el-dialog :title="addtypeTit" :visible.sync="addtypeVisible" width="35%">
            <el-form :model="addtypeform" label-width="140px" :rules="addrules" ref="addtypeform">
                <el-form-item label="上级分类" v-if="addtypeTit === '添加分类'">
                    <el-select v-model="addtypeform.st_superior_id" placeholder="请选择上级分类">
                        <el-option label="房源-用途" value="1"></el-option>
                        <el-option label="客源-用途" value="2"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="分类名称">
                    <el-input v-model="addtypeform.st_name" placeholder="请输入分类名称"></el-input>
                </el-form-item>
                <el-form-item label="前台name名">
                    <el-input v-model="addtypeform.st_type_name" placeholder="请输入前台name名"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="canceladd('addtypeform')">取 消</el-button>
                <el-button type="primary" @click="typeFun('addtypeform')">确 定</el-button>
            </div>
        </el-dialog>
    </div>
    
</template>
<script src='../../contral/leveltypelist.js'></script>
